Skip to content

Conversation

@cyrgani
Copy link
Contributor

@cyrgani cyrgani commented Sep 22, 2025

This PR implements the last step of #68490: marking the std::u8 etc. modules and the constants in std::f32 and std::f64 (but not the undeprecated consts submodule) as fully deprecated.

Revival of #107587 (cc @tgross35).

Closes: #68490

r? libs-api

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 22, 2025
@cyrgani cyrgani added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Sep 22, 2025
@rust-log-analyzer

This comment has been minimized.

@BurntSushi
Copy link
Member

I'm still kind of meh on these deprecations personally, but we should probably finish what was started.

With that said, I'm strongly opposed to applying #[doc(hidden)] to deprecated items. I'm not sure why you're doing that here. It seems like an obviously bad user experience that only serves to gaslight users. Imagine reading old code, wondering what a function does and then going to look it up in the docs only to find that... it isn't there?

Once the #[doc(hidden)] attributes are removed, I'd be happy to kick off an FCP.

@cyrgani cyrgani force-pushed the deprecate-legacy-int-mods branch from 438bfa3 to 7fa9c6a Compare September 22, 2025 13:11
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] build_script_build test:false 0.101
[RUSTC-TIMING] cc test:false 0.663
   Compiling compiler_builtins v0.1.160 (/checkout/library/compiler-builtins/compiler-builtins)
[RUSTC-TIMING] build_script_build test:false 0.237
error: use of deprecated constant `core::f64::EPSILON`: replaced by the `EPSILON` associated constant on `f64`
  --> library/compiler-builtins/compiler-builtins/src/math/../../../libm/src/math/rem_pio2f.rs:21:31
   |
21 | const TOINT: f64 = 1.5 / f64::EPSILON;
   |                               ^^^^^^^
   |
   = note: `-D deprecated` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(deprecated)]`

@cyrgani
Copy link
Contributor Author

cyrgani commented Sep 22, 2025

I've removed the #[doc(hidden] attributes.
Regarding why I added them, it is mostly the feeling that having twelve deprecated modules right on the front page of the std documentation is not a good user experience either.
Also, people who would search the docs for core::u8::MAX would still get u8::MAX as their first search result to find out what the constant means.

@cyrgani cyrgani changed the title fully deprecate and hide the legacy integral modules fully deprecate the legacy integral modules Sep 22, 2025
@BurntSushi
Copy link
Member

Regarding why I added them, it is mostly the feeling that having twelve deprecated modules right on the front page of the std documentation is not a good user experience either.

Perhaps! But the solution is definitely not to completely hide them.

Also, people who would search the docs for core::u8::MAX would still get u8::MAX as their first search result to find out what the constant means.

Sure, same thing applies here. I don't know anything about how rustdoc's search result ranking works, but it seems reasonable that it could take deprecation status into account.

@BurntSushi
Copy link
Member

@rfcbot merge

@rust-rfcbot
Copy link
Collaborator

rust-rfcbot commented Sep 22, 2025

Team member @BurntSushi has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Sep 22, 2025
tgross35 pushed a commit to rust-lang/compiler-builtins that referenced this pull request Sep 22, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Oct 9, 2025
…mdev

give a better example why `std` modules named like primitives are needed

A small update to the `std` `lib.rs` introduction to replace mentions of `std::i32` (never needed) with `std::char` (sometimes needed).
Related to rust-lang#146882.
Zalathar added a commit to Zalathar/rust that referenced this pull request Oct 9, 2025
…mdev

give a better example why `std` modules named like primitives are needed

A small update to the `std` `lib.rs` introduction to replace mentions of `std::i32` (never needed) with `std::char` (sometimes needed).
Related to rust-lang#146882.
rust-timer added a commit that referenced this pull request Oct 9, 2025
Rollup merge of #147373 - cyrgani:cyrgani-patch-1, r=ibraheemdev

give a better example why `std` modules named like primitives are needed

A small update to the `std` `lib.rs` introduction to replace mentions of `std::i32` (never needed) with `std::char` (sometimes needed).
Related to #146882.
github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request Oct 10, 2025
…mdev

give a better example why `std` modules named like primitives are needed

A small update to the `std` `lib.rs` introduction to replace mentions of `std::i32` (never needed) with `std::char` (sometimes needed).
Related to rust-lang#146882.
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Oct 13, 2025
give a better example why `std` modules named like primitives are needed

A small update to the `std` `lib.rs` introduction to replace mentions of `std::i32` (never needed) with `std::char` (sometimes needed).
Related to rust-lang/rust#146882.
@rust-rfcbot rust-rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Oct 15, 2025
@rust-rfcbot
Copy link
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

@RalfJung
Copy link
Member

marking the std::u8 etc. modules as fully deprecated and as #[doc(hidden)].

It seems the doc(hidden) part got removed; please also update the PR description since it will permanently become part pf the git history.

@rust-rfcbot rust-rfcbot added the finished-final-comment-period The final comment period is finished for this PR / Issue. label Oct 25, 2025
@rust-rfcbot rust-rfcbot added to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Oct 25, 2025
@rust-rfcbot
Copy link
Collaborator

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@matthiasg
Copy link

I've removed the #[doc(hidden] attributes. Regarding why I added them, it is mostly the feeling that having twelve deprecated modules right on the front page of the std documentation is not a good user experience either.

This might be a general area of improvement of Rust Docs. Move older deprecated modules/structs/etc into a hidden state (if anything was deprecated an automatic mention at top to 'optionally include them'), search would not be affected of course.

When I say 'older' I literally mean code deprecated eg 12 months ago based on publishing date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. to-announce Announce this issue on triage meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking issue for RFC 2700: numeric constants as associated consts

7 participants